import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router'

import { AppComponent } from './app.component';
import {HeroService} from './hero.service'
import {HeroesComponent} from './heroes.component'
import {HeroDetailComponent} from './hero-detail.component'
import {DashboardComponent} from './dashboard.component'

@NgModule({
  declarations: [
    AppComponent,
    HeroesComponent,
    HeroDetailComponent,
    DashboardComponent

  ],
  imports: [
    BrowserModule,
    FormsModule,
    RouterModule.forRoot([
      {
        path:'',
        redirectTo:'./dashboard',
        pathMatch:'full'
      },
      {
        path: 'heroes',
        component: HeroesComponent
      },
      {
        path:'dashboard',
        component:DashboardComponent
      }
    ])
  ],
  providers: [HeroService],
  bootstrap: [AppComponent]
})
export class AppModule { }
